import request from '../../utils/request.js'

// 新增渠道
export const addChannels = (data: any) => {
    return request({ url: `/tienchin/channel`, method: "POST", data: data })
}

// 更新渠道
export const updateChannels = (data: any) => {
    return request({ url: `/tienchin/channel`, method: "PUT", data: data })
}

// 渠道数据导出
export const exportChannels = (data: any) => {
    return request({ url: `/tienchin/channel/export`, method: "POST", data: data })
}

// 导入数据
export const importChannels = (data: any) => {
    return request({ url: `/tienchin/channel/importData`, method: "POST", data: data })
}

// 导入模板
export const importTemplate = (data: any) => {
    return request({ url: `/tienchin/channel/importTemplate`, method: "POST", data: data })
}

// 查询所有渠道列表
export const getAllChannelslists = (data: any) => {
    return request({ url: `/tienchin/channel/list`, method: "GET", params: data })
}

// 根据id(可多个)删除渠道
export const deleteAllChannels = (channelIds: any, data: any) => {
    return request({ url: `/tienchin/channel/${channelIds}`, method: "DELETE", data: data })
}

// 根据渠道ID查询一个具体的渠道
export const getIDChannellists = (channelId: any) => {
    return request({ url: `/tienchin/channel/${channelId}`, method: "GET"})
}
